home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ETO Development Tools 4
/
ETO Development Tools 4.iso
/
Tools - Objects
/
Virtual User 1.0
/
Example Scripts
/
HierarchicalExample.vu
< prev
next >
Wrap
Text File
|
1991-01-25
|
2KB
|
75 lines
#
# File HierarchicalExample.vu
#
# Contains: An example of selecting menuitems which belong to submenus
# Prerequisite : AppleLink application with Help enabled (should
# have the help file) should be launched and be the frontmost app.
# Get rid of the login dialog, either by logging in or Working off
# line.
#
# Conventions: Global variables begin with a capital letter
#
# Written by: P Nagarajan
#
# Copyright: © 1990 by Apple Computer, Inc., all rights reserved.
#
# Change History:
#
# 2/21/90 naga creation
# 1/08/91 Rick modified to run with either AppleLink 5.11 or 6.0
#
####
# First make sure if the target is configured right
match[application t:?app_name]!;
if not (app_name ~= /AppleLink≈/)
begin
println "This script requires Apple Link to be the frontmost application";
exit;
end; #check if Apple Link is running
if not (match [menuItem t:'Help' e:true m:[menu o:1]]!)
begin
println "Your Apple Link does not have Help installed";
println "Please try installing Help file into AppleLink folder and try again";
exit;
end;# check if Help menuitem is enabled
if (match [window s:dialog o:1]!)
begin
if (match[button t:'Work off line' w:[window o:1]]!)
select [button t:'Work off line' w:[window o:1]]!;
else
begin
println "Sorry cannot get rid of the dialog";
exit;
end;
end; #Check if there is a dialog up on the front(maybe Connect/Login dialog)
####
# Now do some menu item selections
select [menuItem t:/≈New Memo≈/
m:[menuItem t:'Working With Memos'
m:[menuItem t:'Help' m:[menu o:1]]]]!;
####
# The following two statements will also work but are not as efficient
select [menuItem t:/≈New Memo≈/
m:[menuItem t:'Working With Memos']]!;
####
# This statement is least efficient
select [menuItem t:/≈New Memo≈/]!;
####
# Now some matching:
match [menuItem t:?item_title
h:{ [menuItem t:'Introduction'],
[menuItem t:/Using≈/]}]!;
# This match takes a lot of time, since there are a lot of submenus and a lot
# of items in each. Hence avoid giving the 'h:' trait if possible in your scripts.
# Here we used it as an illustration of its utility.
println item_title;